#if 0

// acc toward mouse pos
if (1 || dragging)
{

	float x = force_x; 
	float y = force_y; 
	if (dragging)
	{
		x = (float)mouse_x;
		y = (float)mouse_y;
	}

	Vector2 to = m_pos - Vector2(x,y);
	float force = 1000.0f/to.Length2();
	if (!dragging && force_dir)
	{
		if (force > 1000.0f) force = 1000.0f;
		//m_vel += to.Normal() * force;
		m_vel += to * force;
		// friction
		m_vel -= m_vel * 0.03f;
		m_vel += Vector2(rnd(10000)/1000.0f-5.0f,rnd(10000)/1000.0f-5.0f);
	}
	else
	{
		if (force > 1.0f) force = 1.0f;
		//force = 1.0f;
		m_vel -= to.Normal() * force * 50.0f;
		// friction
		m_vel -= m_vel * 0.02f;
	}

}
else
{
	// bit of randomness
	m_vel += Vector2(rnd(10000)/1000.0f-5.0f,rnd(10000)/1000.0f-5.0f);
	// bit of gravity
	m_vel += Vector2(0.0f,10.0f);
	// friction
	m_vel -= m_vel * 0.002f;
}

#endif

#if 0

#include <iostream>
 #include <windows.h>
 #include <stdio.h>
 #include <pdh.h>
 #include <pdhmsg.h>

#pragma comment(lib, "pdh.lib")
 
 #define KB 1024
 void main(int argc, char *argv[]){
 
     PDH_HQUERY hquery;
     PDH_HCOUNTER hcountercpu;
     PDH_HCOUNTER hcounterram;
     PDH_STATUS status;
     LPSTR pMessage;
     PDH_FMT_COUNTERVALUE countervalcpu;
     PDH_FMT_COUNTERVALUE countervalram;
     MEMORYSTATUSEX memstat;
     
     memstat.dwLength = sizeof (memstat);
 
     if((status=PdhOpenQuery(NULL, 0, &hquery))!=ERROR_SUCCESS){
         printf("PdhOpenQuery %lx\n", status);    
         goto END;
     }
 
     if((status=PdhAddCounter(hquery,
                             TEXT("\\Processor(_Total)\\% Processor Time"),
                             0, &hcountercpu))!=ERROR_SUCCESS)
	 {
         printf("PdhAddCounter (cpu) %lx\n", status);    
         goto END;
     }
     if((status=PdhAddCounter(hquery,
                             TEXT("\\Memory\\Available Bytes"),
                             0, 
                             &hcounterram))!=ERROR_SUCCESS){
         printf("PdhAddCounter (ram) %lx\n", status);    
         goto END;
     }
     
     /*Start outside the loop as CPU requires difference 
     between two PdhCollectQueryData s*/
     if((status=PdhCollectQueryData(hquery))!=ERROR_SUCCESS){
         printf("PdhCollectQueryData %lx\n", status);    
         goto END;
     }
 
     while(true){
 
         if((status=PdhCollectQueryData(hquery))!=ERROR_SUCCESS){
             printf("PdhCollectQueryData %lx\n", status);    
             goto END;
         }
         if(GlobalMemoryStatusEx(&memstat)==0){
             printf("GlobalMemoryStatusEx %d\n", GetLastError());
             goto END;
         }
 
         if((status=PdhGetFormattedCounterValue(hcountercpu, 
                                                 PDH_FMT_LONG, 
                                                 0, 
                                                 &countervalcpu))!=ERROR_SUCCESS){
             printf("PdhGetFormattedCounterValue(cpu) %lx\n", status);    
             goto END;
         }
         if((status=PdhGetFormattedCounterValue(hcounterram, 
                                                 PDH_FMT_LONG, 
                                                 0, 
                                                 &countervalram))!=ERROR_SUCCESS){
             printf("PdhGetFormattedCounterValue(ram) %lx\n", status);    
             goto END;
         }
         printf("cpu %3d%% \tmem %3d%% \tavail (%d mb)\n", 
             countervalcpu.longValue, 
             memstat.dwMemoryLoad, 
             countervalram.longValue/(KB*KB));
 
         Sleep(1000);
 
     }
 END:
     ;
 }

#endif

 #if 0	//Timer Pause and Unpause with RunTime Works

	Timer.Update();

	cout << Timer.GetTimeSinceStart() << endl;

	Timer.Pause();

	Sleep(1000);

	Timer.Update();

	cout << Timer.GetDeltaTime() << endl;

	Timer.Unpause();

	Timer.Update();

	cout << Timer.GetDeltaTime() << endl;

	///////////////////////////////////////////////////

	Timer.Initialize();

	Timer.Pause();

	Timer.Update();

	cout << Timer.GetTimeSinceStart() << endl;
	cout << Timer.GetRunTime() << endl;

	Timer.Update();

	Sleep(1500);

	Timer.Update();

	Timer.Unpause();

	Timer.Update();

	cout << Timer.GetTimeSinceStart() << endl;
	cout << Timer.GetRunTime() << endl;

#endif

#if 0 //Save and Load Work if needed

	cout << RNGEN->SaveSeed() << endl;

	cout << RNGEN->LoadLastSeed() << endl;

	cout << RNGEN->RandD(FASTSEED, 0.0, 1920.0) << endl;

#endif